<?php global $comfy; ?>
<div id="sidebar">

<?php if (is_page()) : ?>
<ul class="widgets">
	<li><h2>Sub Pages<a href="#minimize" class="Wminimize"></a><a href="#close" class="Wclose"></a></h2>
		<ul>
		<?php
		$pages = get_pages('child_of='.$post->ID);
		foreach($pages as $child) {
		print '<li>';
		print '<a href="'.get_permalink($child->ID).'" title="'.$child->post_title.'">';
		print $child->post_title;
		print '</a>';
		print '</li>';
	}
	?>
		</ul>
	<span class="foot"></span></li>
</ul>
<?php endif; ?>

<?php if (is_single()) : ?>
<?php if (is_page()) $tle = PAGE; else $tle = POST; ?>
<?php include TEMPLATEPATH. '/widgets/admin_menu.html'; ?>
<?php include TEMPLATEPATH. '/widgets/writer.html'; ?>
<?php include TEMPLATEPATH. '/widgets/info.html'; ?>
<?php endif; ?>

<?php if (is_category()) : ?>
<?php include TEMPLATEPATH. '/widgets/category_tabs.html'; ?>
<?php endif; ?>

<?php include TEMPLATEPATH. '/widgets/subscription.html'; ?>
<?php include TEMPLATEPATH. '/widgets/300x250ads.html'; ?>
<?php if (!is_category()) : ?>
<?php include TEMPLATEPATH. '/widgets/ajaxtabs.html'; ?>
<?php endif; ?>
<?php include TEMPLATEPATH. '/widgets/media.html'; ?>
<?php include TEMPLATEPATH. '/widgets/widgets.html'; ?>

</div><div class="clear"></div>